package edu.bw.dao;

import edu.bw.dto.InsertRoleForm;
import edu.bw.dto.SelectRoleByConditionForm;
import edu.bw.dto.UpdateRoleForm;
import edu.bw.pojo.Role;

import java.util.List;
import java.util.Map;

public interface RoleDao {
    List<Map<String, Object>> selectDeptByCondition(SelectRoleByConditionForm selectCondition);

    Long SelectDeptByConditionCount(SelectRoleByConditionForm selectCondition);

    Integer insert(Role role);

    List<Map<String, Object>> selectById(Integer id);

    Integer update(UpdateRoleForm updateRoleForm);

    /**
     *
     * @param ids 待删除的角色的id
     * @return 如果待删除的角色关联的有用户,返回false,不能删,否则返回true
     */
    boolean selectCanDelete(List<Integer> ids);

    /**
     *
     * @param ids 待删除的角色的id
     * @return 删除的条数
     */
    Integer deleteRoleByIds(List<Integer> ids);

    List<Map<String, Object>> selectAllRole();
}
